package org.h2.server;

import java.io.UnsupportedEncodingException;
import java.sql.SQLException;

import org.h2.tools.Server;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


/**
 * https://www.cnblogs.com/yoyotl/p/11529625.html
 * ClassName: H2ServerApplication <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON(可选). <br/>
 * date: 2019年10月21日 上午11:39:33 <br/>
 *https://www.cnblogs.com/yoyotl/p/11529625.html
 *https://www.cnblogs.com/cnjavahome/p/8995650.html
 *https://blog.csdn.net/guicaizhou/article/details/51862423
 * @author admin
 * @version
 * @since JDK 1.8
 */
@SpringBootApplication
public class H2ServerApplication {
    public static void main(String[] args) throws UnsupportedEncodingException {
        //startH2Server();
        //SpringApplication.run(H2ServerApplication.class, args);
	String	imgPath = java.net.URLDecoder.decode("km91QVXjZkcdjyoRPd%2FxeFPER9hD0ywaE0MktLPo%2Bo3aTji8V99dtryewmSXBejQ8EDi06Wg7Y4a%0A6%2BLNwoTMPw%3D%3D", "UTF-8");
	System.out.println(imgPath);

    }
    
    
    private static void startH2Server()
    {
      try
      {
        Server localServer = Server.createTcpServer(new String[] { "-tcpPort", "9092", "-tcpAllowOthers" }).start();
        if (localServer.isRunning(true)) {
          System.out.println("H2 server was started and is running.");
        } else {
          throw new RuntimeException("Could not start H2 server.");
        }
      }
      catch (SQLException localSQLException)
      {
        throw new RuntimeException("Failed to start H2 server: ", localSQLException);
      }
    }
}
